<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员页面</title>
    <!-- 确保 Bootstrap 的 CSS 链接正确 -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        body {
            font-family: 'Roboto', sans-serif;
            background-color: #f5f5f5;
            margin: 0;
            padding: 0;
        }

        header {
            background-color: #4CAF50;
            color: white;
            padding: 20px;
            text-align: center;
        }

        nav ul {
            list-style-type: none;
            padding: 0;
            background-color: #333;
        }

        nav ul li {
            display: inline;
            margin-right: 0;
        }

        nav ul li a {
            color: white;
            padding: 14px 20px;
            display: inline-block;
            text-decoration: none;
        }

        nav ul li a:hover {
            background-color: #ddd;
            color: black;
        }

        .sidebar {
            width: 250px;
            background-color: #333;
            color: white;
            padding: 20px;
            height: 100vh;
            overflow: auto;
            position: fixed;
            top: 0;
            left: 0;
            transition: left 0.3s ease;
        }

        .sidebar.hidden {
            left: -250px;
        }

        .sidebar li a {
            color: white;
            display: block;
            padding: 10px 0;
            text-decoration: none;
        }

        .sidebar li a:hover {
            background-color: #575757;
        }

        .main-content {
            margin-left: 270px;
            padding: 20px;
            background-color: white;
            transition: margin-left 0.3s ease;
        }

        .main-content.sidebar-hidden {
            margin-left: 0;
        }

        .toggle-sidebar-btn {
            position: fixed;
            top: 20px;
            left: 270px;
            cursor: pointer;
            background-color: #4CAF50;
            color: white;
            padding: 10px 20px;
            border-radius: 5px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .card {
            margin-bottom: 20px;
            border: 1px solid #ddd;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .card h2 {
            margin-top: 0;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-group label {
            display: block;
            margin-bottom: 5px;
        }

        .form-group input,
        .form-group textarea {
            width: 100%;
            padding: 8px;
            box-sizing: border-box;
        }

        .btn {
            display: inline-block;
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
            text-align: center;
            text-decoration: none;
            outline: none;
            border: none;
            border-radius: 5px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        .btn-primary {
            background-color: #4CAF50;
            color: white;
        }

        .btn-primary:hover {
            background-color: #45a049;
        }

        .btn-danger {
            background-color: #f44336;
            color: white;
        }

        .btn-danger:hover {
            background-color: #da190b;
        }

        .btn-cancel {
            background-color: #e7e7e7;
            color: black;
        }

        .btn-cancel:hover {
            background-color: #d0d0d0;
        }
        /* 添加退出按钮的样式 */
        nav ul li:last-child a {
            float: right;
        }

        /* 清除浮动 */
        nav::after {
            content: "";
            display: table;
            clear: both;
        }
        canvas {
            /* 适当减小宽度和高度 */
            max-width: 600px;
            max-height: 300px;
            margin: 20px auto;
        }
    </style>
</head>
<body>
<header>
    <h1>管理员控制面板</h1>
</header>
<nav>
    <ul>
        <li><a href="#" onclick="showManagement('users')">用户管理</a></li>
        <li><a href="#" onclick="showManagement('products')">产品管理</a></li>
        <li><a href="#" onclick="showManagement('orders')">订单管理</a></li>
        <li><a href="#" onclick="showManagement('inventory')">库存管理</a></li>
        <li><a href="bestSellerChar.html">畅销商品排行</a></li>
        <li style="float: right;" onclick="logout()"><a>退出登录</a></li>
    </ul>
</nav>
<div class="content">
    <div class="sidebar">
        <ul>
            <li><a href="#" onclick="showManagement('users')">用户管理</a></li>
            <li><a href="#" onclick="showManagement('products')">产品管理</a></li>
            <li><a href="#" onclick="showManagement('orders')">订单管理</a></li>
            <li><a href="#" onclick="showManagement('inventory')">库存管理</a></li>
            <li><a href="bestSellerChar.html">畅销商品排行</a></li>
        </ul>
    </div>
    <div class="main-content">
    </div>
    <button class="toggle-sidebar-btn" onclick="toggleSidebar()">☰</button>
</div>
<script src="admin.js"></script>
</body>
</html>